package com.example.javafx.路径;

import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.shape.MoveTo;
import javafx.scene.shape.Path;
import javafx.scene.shape.QuadCurveTo;
import javafx.stage.Stage;

public class Main_1 extends Application {
    @Override
    public void start(Stage primaryStage) throws Exception {

        Group root = new Group();
        Scene scene = new Scene(root,300,150);
        primaryStage.setScene(scene);
        primaryStage.setTitle("");

        Path path = new Path();
        MoveTo moveTo = new MoveTo();
        moveTo.setX(0.0f);
        moveTo.setY(50.0f);

        QuadCurveTo quadCurveTo = new QuadCurveTo();
        quadCurveTo.setControlX(25.0f);
        quadCurveTo.setControlY(0.0f);
        quadCurveTo.setX(50.0f);
        quadCurveTo.setY(50.0f);
        path.getElements().add(moveTo);
        path.getElements().add(quadCurveTo);
        root.getChildren().add(path);
        scene.setRoot(root);
        primaryStage.setScene(scene);
        primaryStage.show();
    }

    public static void main(String[] args) {
        launch(args);
    }
}
